<?php 
/**************************************************
 *  MeatBallBot Web-Interface v0.4a               *
 *                                                *
 *  Licenced under the GPLv3                      *
 *                                                *
 *  Originally coded by HttpError (Jordan Songer) *
 **************************************************/ 
include("../inc/include.php");

//checks cookies to make sure they are logged in 
if(isset($_COOKIE['ID_my_site'])) 
{ 
  $user = $_COOKIE['ID_my_site']; 
  $pass = $_COOKIE['Key_my_site']; 
  $check = mysql_query("SELECT * FROM users WHERE user = '$user'")or die(mysql_error()); 
  while($info = mysql_fetch_array( $check )) 
  { 

    //if the cookie has the wrong password, they are taken to the login page 
    if ($pass != $info['password']) 
    { 
      header("Location: ../index.php"); 
    } 
    else 
    {
      $networks = "SELECT * FROM `networks`";
      $netres = mysql_query($networks);
      if (mysql_num_rows($netres) == 0)
      {
        error(418);
      } else {
        while($netres3 = mysql_fetch_array($netres)) 
        {
          $network .= "<option value=".$netres3['id'].">".$netres3['netname'];
        }
?>
<font face='arial' size=2><b>All fields marked with a * are required:<br>
<form enctype='multipart/form-data' action='c_RegProcess.php' method='post'>
<table width='50%' border=0>
<tr><td> network<font color='#ff0000'>*</font></td>
<td>
<select name='network'><?php echo $network; ?></td></tr>
<tr><td> channel<font color='#ff0000'>*</font></td>
<td>
<input type=text name='channel'></td></tr>
<tr><td> calc</td>
<td>
<input type=checkbox name='calc'></td></tr>
<tr><td> chanman</td>
<td>
<input type=checkbox name='chanman'></td></tr>
<tr><td> factoid</td>
<td>
<input type=checkbox name='factoid'></td></tr>
<tr><td> game</td>
<td>
<input type=checkbox name='game'></td></tr>
<tr><td> search</td>
<td>
<input type=checkbox name='search'></td></tr>
<tr><td> delay</td>
<td>
<input type=text name='delay' size=8></td></tr>
<tr><td> callsign<font color='#ff0000'>*</font></td>
<td>
<input type=text name='callsign' size=2></td></tr>
<tr><td> nick<font color='#ff0000'>*</font></td>
<td>
<input type=text name='nick'></td></tr>
</table>
<input type='submit' value='Submit Form'> <input type=reset value='Clear Form'></form>
<?php
      }
    }
  }
} else { header("Location: ../index.php"); }
?>
